<template>
  <div class="skill">
    <p-table bordered rowKey="id" :columns="columns" :data-source="data">
      <a slot="name" slot-scope="text">{{ text }}</a>
    </p-table>
  </div>
</template>

<script type="text/javascript">
import { postAction, getAction, deleteAction, putAction } from "@/api/manage";
import { timestampToDatetime } from "@/utils/util";



const columns = [
  {
    title: '技能代码',
    dataIndex: 'skillCode',
    key: 'skillCode',
  },
  {
    title: '技能名称',
    dataIndex: 'skillName',
    key: 'skillName',
    ellipsis: true,
  },
  {
    title: '技能分类',
    dataIndex: 'skillType',
    key: 'skillType',
    ellipsis: true,
  },
  {
    title: '获取日期',
    dataIndex: 'effectiveDate',
    key: 'effectiveDate',
    ellipsis: true,
    customRender: function (text) {
      return timestampToDatetime(text);
    },
  },
  {
    title: '有效日期',
    dataIndex: 'expirationDate',
    key: 'expirationDate',
    ellipsis: true,
    customRender: function (text) {
      return timestampToDatetime(text);
    },    
  },
  {
    title: '标记',
    dataIndex: 'sign',
    key: 'sign',
    ellipsis: true,
  },
  {
    title: '是否有效',
    dataIndex: 'effect',
    key: 'effect',
    ellipsis: true,
  },
];



export default {
  props: {
    empno: String,
  },
  data() {
    return {
      columns,
      data: [],
      url: {
        list: '/mes-manpower/mesHrMemberSkillAdjustDetail/getListByEmpno'
      }
    }
  },

  watch: {
    empno(){
      this.getSkillInfo()
    }
  },

  mounted() {
    this.getSkillInfo()
  },
  methods: {
    getSkillInfo(){
      const params = {
        empno:this.empno
      }
      getAction(this.url.list, params).then( res => {
        console.log(res.data);
        // debugger
        if (res.success) {
          this.data = res.data
        }
      } )
    }
  },
  components: {

  }
}
</script>

<style lang="less" scoped>
</style>
